﻿CREATE VIEW [acms].[Post_View] WITH SCHEMABINDING 
AS 
	SELECT 
		a.Id,
		a.SiteId,
		c.Name as SiteName,
		a.ParentId,
		a.ParentPath as ParentPath,
		a.Name,
		a.DisplayName,
		a.ThumbnailId,
		a.TemplateId,
		b.Name as TemplateName,
		a.Summary,
		a.Tags,
		a.Sequence,
		a.ParentSequence,
		a.CreatedDateTime,
		a.VersionId
	FROM [acms].[Posts] a
		inner join [acms].[Templates] b on a.TemplateId = b.Id 
		inner join [acms].[Sites] c on a.SiteId = c.Id
	WHERE a.Deleted = 0
		and b.Deleted = 0
;